#!/bin/sh

BASE_DIR=$(dirname $0)

TRANG="$BASE_DIR/../../lib/trang/trang.jar"
SCHEMA="$BASE_DIR/../schema/"
OUTPUT="$BASE_DIR/../../src/"
PACKAGE="net.ahdiaz.rubik.model.generated"


for f in `ls -1 $SCHEMA/*.rng.xml`; do java -jar $TRANG -I rng -O xsd $f $SCHEMA/`basename $f .rng.xml`.xsd; done

for f in `ls -1 $SCHEMA/*.xsd`; do xjc $f -p $PACKAGE -d $OUTPUT; done


BUILD_FILE="$BASE_DIR/build.xml"
SEDNADRIVER="$BASE_DIR/../../lib/sedna/sednadriver.jar"

ant -f $BUILD_FILE -Dbasedir=$BASE_DIR/../../
